#region Using Statements

using System;
using System.Collections.Generic;
using System.Text;
using System.Web.SessionState;

#endregion

namespace Dotss.Core
{

	public abstract class ServerRO
	{
		
		// TODO: Write injectable constructors to take DataAccess object
		// TODO: Move Sql2005 logic to a Sql2005 DataAccess object

		public void Remove(SessionArgs session)
		{
			Data.Remove(session.SessionID, session.ApplicationName, session.EnvironmentName);
		}

		public void ResetTimeout(SessionArgs session)
		{
			Data.ResetTimeout(session);
		}

		public void CreateNew(SessionArgs session)
		{
			Data.CreateNew(session);
		}

		public void Initialize(SessionArgs session)
		{
			Data.Initialize(session);
		}

		public void ReleaseLock(SessionArgs session)
		{
			Data.ReleaseLock(session);
		}

		public void SetItem(SessionArgs session, byte[] items)
		{
			Data.SetItem(session, items);
		}

        protected abstract DataAccess Data { get; }

		public byte[] GetItem(SessionArgs args, bool isExclusive, out bool locked, out TimeSpan lockAge, out int lockId, out SessionStateActions actions)
		{
			return Data.GetItem(args, isExclusive, out locked, out lockAge, out lockId, out actions);
		}

	}
}
